#include <iostream>
#include <cstdio>
#include <string.h>
using namespace std;

signed main()
{
	int n;
	cin>>n;
	int count = 0;
	double sum = 0;
	for(int i=0;i<n;i++){
		char s[1000],p[1000];
		scanf("%s",s);
		double tmp;
		sscanf(s,"%lf",&tmp);
		sprintf(p,"%.2f",tmp);
		int flag = 0;
		for(int i=0;i<strlen(s);i++){
			if(s[i]!=p[i]){
				flag = 1;
				break;
			}
		}
		if(flag||tmp<-1000||tmp>1000){
			printf("ERROR: %s is not a legal number\n",s);
		}
		else{
			count++;
			sum += tmp;
		}
	}
	if(count==1)	printf("The average of %d number is %.2f",count,sum/count);
	else if(count>1)	printf("The average of %d numbers is %.2f",count,sum/count);
	else printf("The average of %d numbers is Undefined",count);
	return 0;
}
